import { Order } from './../models/order';
import * as lodash from 'lodash';

function createItem() {
    return { id: '2', qty: 1, inventoryName: '商品', modifier: [], isLocalStall: true };
}
function thinOrder(order?):Order {
    return lodash.extend({ id:'1', items: lodash.fill(Array(1), createItem()), customerIdentity: '1号桌', description: '', receiveTime: new Date(2016,1,1), stall:['stall1'], isLocalStall:true }, order);
}
function fatOrder(order?, itemLength=20):Order {
    const items = [];
    for (var i = 0; i <itemLength;i++) {
        items.push(lodash.extend(createItem(),{id:''+i}));
    }
    return lodash.extend(thinOrder(order), {items:items});
}
export { thinOrder, fatOrder };